1. Field of the Invention
The present invention generally relates to computer graphics and more particularly to a method and system for performing texture mapping across adjacent texture maps.
2. Description of the Related Art
Unless otherwise indicated herein, the approaches described in this section are not prior art to the claims in this application and are not admitted to be prior art by inclusion in this section.
A graphics system generally adopts a highly parallel and pipelined architecture to meet the ever increasing processing demands for realism, quality, and real-time interactivity of displayed images and videos. To determine the final surface properties of an object or image, one of the functions performed by a shader engine in a rendering pipeline includes texture mapping. Conventionally, the texture mapping operation involves a process by which texture elements in the texture coordinate space are mapped or wrapped onto a computer-generated object. In particular, for each rendered pixel in the screen space, selected texture elements are used to either substitute for or scale one or more material properties of the object's surface. A texture element, also called texel in the art of computer graphics, is an elementary portion of the texture mapping image used to define texture characteristics such as color attributes, lighting, and transparency.
Recently developed computer graphics applications, such as scientific visualization or oil exploration systems, are becoming increasingly complex and demanding higher image details. Texture mapping operations in these applications tend to involve storing and processing very large texture maps. Since existing graphics hardware solutions have limited memory resources, one current texture mapping technique breaks a large texture map into a smaller set of texture maps, each of which is referred to as a “tile” herein, and is addressed individually within memory. Rather than dealing with the large texture map in its entirety, the graphics hardware thus maps only from one smaller piece of the large texture map at a time.
The current approach of breaking a large texture map into multiple smaller tiles that are then treated as separate, unrelated texture maps has a number of shortcomings, especially in dealing with borders between neighboring tiles. For example, without a mechanism to directly access the texels of an adjacent tile, one operating mode specifies an overlapping border area between two neighboring tiles, where the overlapping border area contains replicated texels from each of the two tiles. To carry out linear filtering under this operating mode, the device driver for the graphics processing unit (GPU) first replicates the relevant texels to generate the overlapping border area and then accesses these replicated texels by deploying a texture filter kernel of a fixed size (e.g., 2×2), which corresponds to the size of the overlapping border area. Although this mode allows texels residing in a neighboring tile to be accessed in filtering operations, the number of such texels is limited by the size of the specified overlapping border area. Further, the larger the specified overlapping border area is, the more data the device driver has to copy and the more likely the increased memory and processing requirements necessary to handle the larger overlapping border area will be prohibitively costly.
Other operating modes implemented when a large texture map is broken into a set of smaller tiles also suffer from certain drawbacks. In particular, these operating modes involve clamping, repeating, and mirroring mechanisms, none of which attempts to extend texture mapping beyond the border of a particular tile. For example, suppose linear filtering is performed at the border of two neighboring tiles, a left tile and a right tile, and suppose a filtering operation is currently operating on the left tile. If a texture request is made for a texel residing in the right tile, under these modes, the system would only identify a texel within the left tile to satisfy the request and does not attempt to access any texel or replicated texel beyond the border of the left tile. Consequently, these operating modes tend to yield lower image quality.
As the foregoing illustrates, what is needed in the art is a technique to access texels in adjacent texture maps that address at least one of the problems set forth above.